namespace EyeOpen.Domain.Transactional
{
	using System;

	public abstract class UnitOfWork
		: IDisposable
	{
		private readonly ITransactionalCollection transactionalCollection;

		protected UnitOfWork(ITransactionalCollection transactionalCollection)
		{
			this.transactionalCollection = transactionalCollection;
		}

		protected ITransactionalCollection TransactionalCollection
		{
			get
			{
				return transactionalCollection;
			}
		}

		public virtual void Commit()
		{
			transactionalCollection.Commit();
		}

		public virtual void Dispose()
		{
			transactionalCollection.Dispose();
		}
	}
}